#!/bin/bash
# 注意，这里大家不可能一次性全部看懂，只需要知道有这些语法即可，一切参考 https://gpt.zanglikun.com

# for循环
for i in {1..5}; do
    echo "循环迭代：$i"
done


# while循环
counter=0
while [ $counter -lt 5 ]; do
    echo "循环迭代：$counter"
    counter=$((counter + 1))
done


# if条件判断
num=10
if [ $num -gt 0 ]; then
    echo "数字大于0"
elif [ $num -eq 0 ]; then
    echo "数字等于0"
else
    echo "数字小于0"
fi